package cn.hinglo.gameclaw.user.bean;


import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * @createTime: 2017/12/29
 * @author: HingLo
 * @description: 地址管理的实体
 */
@Data
@Table(name = "address")
@Accessors(chain = true)
public class Address implements Serializable {
    @Id
    private Long id;

    @Column(name = "user_id")
    private String userId;

    @NotNull(message = "地址不能为空")
    private String addr;

    @Column(name = "zip_code")
    @Size(min = 6, max = 6, message = "邮编长度不正确")
    @NotNull(message = "邮编不能为空")
    private String zipCode;

    @NotNull(message = "请填写详细地址")
    @Column(name = "detailed_addr")
    private String detailedAddr;

    /**
     * 收件人
     */
    @NotNull(message = "请填写收件人名字")
    private String name;

    @NotNull(message = "请填写收件人的电话号码")
    private String phone;

    /**
     * 是否设置为默认地址
     */
    private Boolean status;

    /**
     * 该地址是作为使用，即删除后不是真正的删除
     */
    private Boolean state;

    /**
     * 创建时间
     */
    private Date date;


}
